package cn.edu.ujn.multiple.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.edu.ujn.multiple.dao.OrdersMapper;
import cn.edu.ujn.multiple.model.Orders;
import cn.edu.ujn.multiple.service.IOrdersService;

@Service("ordersService")
@Transactional
public class OrdersServiceImpl implements IOrdersService {

	@Autowired
	private OrdersMapper ordersDao;

	@Override
	public List<Orders> selectByCustId(Integer id) {
		// TODO Auto-generated method stub
		return ordersDao.selectByCustId(id);
	}

	@Override
	public List<Orders> findAll() {
		// TODO Auto-generated method stub
		List<Orders> list = ordersDao.findAll();
		return list;
	}

	@Override
	public Orders selectByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		Orders orders = ordersDao.selectByPrimaryKey(id);
		return orders;
	}

	@Override
	public int insert(Orders orders) {
		// TODO Auto-generated method stub
		int insertSelective = ordersDao.insertSelective(orders);
		return insertSelective;
	}

	@Override
	public int update(Orders orders) {
		// TODO Auto-generated method stub
		int updateByPrimaryKeySelective = ordersDao.updateByPrimaryKeySelective(orders);
		return updateByPrimaryKeySelective;
	}

	@Override
	public int delete(Integer id) {
		// TODO Auto-generated method stub
		int deleteByPrimaryKey = ordersDao.deleteByPrimaryKey(id);
		return deleteByPrimaryKey;
	}
	
}
